1. Field of the Invention
The present invention relates to color conversion processing of image data, and particularly to a technique for improving the processing efficiency.
2. Description of the Related Art
For data that are handled in a display, printer, personal computer and the like, color information is managed in each peculiar color space. When sending and receiving data between different devices, it may be necessary to perform color conversion to the color spaces handled by the devices and color conversion processing that enables reflection of the featured of the devices. As color conversion processing, there has been known a conversion system that mainly uses numeric calculations with polynomials and determinants, and a conversion system that mainly refers to a table, such as a system that uses an n-dimensional lookup table to decide an output color for an n-component input.
These conversion systems are selected in accordance with the required color reproduction accuracy, speed and so on. In color conversion from an sRGB color space handled in a screen display of PC or the like to a peculiar RGB color space handled in a display, the system using a determinant is mainly employed. In color conversion from a color space of sRGB or CMYK handled at the time of application printing on PC to a CMYK color space peculiar to a printer, since nonlinear processing is often carried out and correction of a color of a particular hue can be made, the system referring to a table is mainly employed.
In color conversion processing using a multi-dimensional table in accordance with the table-referring system, the table size is too large if combinations output values corresponding to all the combinations of input values are stored. Therefore, a principally used method is to divide an input color space at equal spacing by lattice points (division points) for each color component, as shown in FIG. 20, then only storing output values of vertices of the lattice divided by the lattice points, and for an input value located between lattice points, calculating an output value by interpolation with the values of the lattice points forming the lattice to which the input value belongs (see FIG. 21 and FIG. 22). The data format of the multi-dimensional lookup table is generally supported by the standard format of the ICC profile prescribed by the International Color Consortium (ICC), and it is also supported as apart of the Color Rendering Dictionary (CRD) of Postscript, which is a kind of page description language used to describe printer data. In these formats, output value data (CMY, CMYK and so on) corresponding to lattice points (RGB and so on) that divide the coordinate axes of each color component in the input color space are arrayed and managed on a memory area in ascending order of coordinate values of respective component coordinates in the input color space (see FIG. 12).
In the color conversion processing using the above multi-dimensional color conversion lookup table (LUT), an output value of color conversion processing is calculated by interpolation based on the color value in the input color space and the output value stored on the multi-dimensional LUT.
As interpolation methods in this calculation, a “four-point interpolation method” and an “eight-point interpolation method” are often used. In the eight-point interpolation method, interpolation is made by using an input value and output values corresponding to eight lattice points located at all the vertices of the lattice to which the input value belongs in the input color space (see FIG. 4). In the four-point interpolation method, interpolation is made by using an input value and output values corresponding to four lattice points selected from the eight lattice points of the lattice to which the input value belongs in the input color space.
In the color conversion processing based on interpolation using the multi-dimensional LUT as described above, the data size of the LUT can be restrained to a certain extent and the degree of tint correction or the like can be finely adjusted. However, in the case of realizing the color conversion processing on software, the volume of data to be handled and the quantity of calculation processing are larger than in the case of using a determinant, and processing is slower than the color conversion processing that mainly uses calculations. Therefore, it takes a long processing time to process image data of a large data size.
A configuration to solve this problem of processing time by using hardware having a CPU, a memory and a cache memory, and the four-point interpolation method (FIG. 23 and FIG. 24). Here, a CPU 901 is assumed to have a register 902 to store data that is used for calculations. A cache memory 904 has a smaller capacity than a main memory 908 but its access speed from the CPU 901 is higher than that of the main memory 908, and data handled at a time in processing of a program is limited to one place on its memory area. Thus, the cache memory is hardware to increase the program execution speed by utilizing the locality of data. Here, it is assumed that four lattice points to be used in the four-point interpolation method are selected as shown in FIG. 6.
The four-point interpolation includes processing to load data of four colors on the LUT to the register 902 in order to calculate them in the CPU 901. In this processing, in loading the first color V(rn, gn, bn) of the four colors (the colors at four lattice points) to the register 902, a command to load data at a memory address where V(rn, gn, bn) is stored, is used (FIG. 23 (1)). Here, the memory controller searches for whether the data of the address which the CPU 901 tries to access is in the cache memory 904 or not. In this case, since V(rn, gn, bn) is accessed for the first time, it does not exist in the cache memory 904. The memory controller collectively loads continuous data including the address of V(rn, gn, bn) from the main memory 908 into the cache memory 904 (FIG. 23 (2) and (3)) and the data is loaded to the register 902 (FIG. 23 (4)). Next, the program loads the next color V(rn, gn, bn+1) (FIG. 24). This data is arranged next to V(rn, gn, bn) in the main memory 908. In accordance with a loading command for this data (FIG. 24 (1)), the memory controller searches for whether the data is in the cache memory 904 or not. Here, it is assumed that the color value data V(rn, gn, bn+1) has been collectively copied together with the previous color value data V(rn, gn, bn) to the cache memory 904. As a result of the search, it is found that V(rn, gn, bn+1) exists in the cache memory 904, and it is copied from the cache memory 904. As a result, the execution of the program is shortened by the data loading time from the main memory 908 to the cache memory 904. This shortening time varies depending on the hardware, and there is a time difference of several times to several ten times.
Moreover, the third color V(rn+1, gn, bn) is loaded to the register 902. As shown in FIG. 12, this data is arranged at an address that is neither next to V(rn, gn, bn) nor to V(rn, gn, bn+1) in the main memory 908. The probability that this data have been copied to the cache memory 904 together with the previously loaded data of two colors, is extremely low. Here, it is assumed that the color value V(rn+1, gn, bn) has not been copied to the cache memory 904 in the previous data loading of the two colors. In this processing, the color value V(rn+1, gn, bn) is loaded from the main memory 908. Finally, a color value V(rn, gn+1, bn+1) is loaded to the register 902. For the same reason as the third color, the possibility that this data has been copied to the cache memory 904 is low, and it is loaded from the main memory 908.
In this manner, the data management structure of the cache memory is one-dimensional, and in the case of loading the multi-dimensional LUT, the cache works only partly and the program processing speed cannot be improved sufficiently. This problem becomes more prominent when the number of data on the multi-dimensional LUT is increased (the division space by lattice points is narrowed) in order to make more detailed color adjustment.